package com.xiaojian.pick.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Data
public class Collect {
    private Integer id;     // 主键
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    private Commodity commodity;    // 收藏的商品
    private User user;  // 收藏的用户

    public Collect(Integer id, Date createTime, Commodity commodity, User user) {
        this.id = id;
        this.createTime = createTime;
        this.commodity = commodity;
        this.user = user;
    }

    public Collect() {
    }

    @Override
    public String toString() {
        return "Collect{" +
                "id=" + id +
                ", createTime=" + createTime +
                ", commodity=" + commodity +
                ", user=" + user +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Commodity getCommodity() {
        return commodity;
    }

    public void setCommodity(Commodity commodity) {
        this.commodity = commodity;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}